<style tyle="text/css">
  .modal-lg {
      width: 50%;
  }
</style>
<div class="modal-header">
  <h4 class="modal-title">添加公益游产品</h4>
</div>
<div class="modal-body">
  <form name="form" class="form-horizontal ng-pristine ng-valid-required">
    <div class="form-group">
      <label class="col-lg-3 control-label">机构名称：</label>
      <div class="col-lg-6">
        <ui-select ng-model="item.company" theme="bootstrap">
          <ui-select-match placeholder="选择机构..">{{$select.selected.name}}</ui-select-match>
          <ui-select-choices repeat="company in company_list | filter: $select.search">
            <span ng-bind-html="company.name | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
    <div class="form-group">
      <label class="col-lg-3 control-label">活动名称：</label>
      <div class="col-lg-6">
        <ui-select ng-model="item.activity" theme="bootstrap">
          <ui-select-match placeholder="选择活动..">{{$select.selected.title}}（每日库存:{{$select.selected.stock}}）</ui-select-match>
          <ui-select-choices repeat="activity in activities | filter: $select.search | filter: stock">
            <span>{{activity.title}}（每日库存:{{activity.stock}}）</span>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
    <div class="form-group">
      <label class="col-lg-3 control-label">出游日期：</label>
      <div class="col-lg-4">
        <div class="pull-left input-group" ng-click="dateOpen($event, item)">
          <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="item.tour_date"
            is-open="item.opened" readonly close-text="关闭" current-text="今天" clear-text="清除"
            ng-required="true"/>
          <span class="input-group-btn">
            <button type="button" class="btn btn-default">
              <i class="glyphicon glyphicon-calendar"></i>
            </button>
          </span>
        </div>
      </div>
    </div>
    <div class="form-group">
      <label class="col-lg-3 control-label">分配名额：</label>
      <div class="col-lg-4">
        <div class="input-group">
          <input type="number" class="form-control" ng-model="item.tour_stock">
          <span class="input-group-addon">人</span>
        </div>
      </div>
    </div>
  </form>

</div>
<div class="modal-footer">
  <button class="btn btn-success" type="button" ng-click="ok()">确定</button>
  <button class="btn btn-danger" type="button" ng-click="cancel()">取消</button>
</div>